﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using Common.Base;
    using HRM.CORE;
    using HRM.CORE.Process;
    
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms; using Common;
    using APP.HELPER.Utils.Language;

    public class xfmProcess : XtraForm
    {


        #region initializeControl
        private Bar bar1;
        private BarButtonItem barButtonItem2;
        private BarButtonItem barButtonItem3;
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarEditItem bbiBeginDate;
        private BarEditItem bbiEndDate;
        private BarEditItem bbiFilter;
        private BarEditItem bbiFilterBy;
        private BarButtonItem bbiView;
        private ComboBoxEdit cboBranch;
        private ComboBoxEdit cboDepartment;
        private BarEditItem cboEmployeeName;
        private ComboBoxEdit cboGroup;
        private CheckEdit chbSex;
        private IContainer components = null;
        private GridColumn gridColumn1;
        private GridColumn gridColumn2;
        private GridColumn gridColumn3;
        private GridColumn gridColumn4;
        private GridColumn gridColumn5;
        private GridColumn gridColumn6;
        private GridColumn gridColumn7;
        private GroupControl groupControl1;
        public DevExpress.Utils.ImageCollection imageCollection2;
        private PictureEdit imgPhoto;
        private LabelControl lcBranch;
        private LabelControl lcCellPhone;
        private LabelControl lcDepartment;
        private LabelControl lcEmail;
        private LabelControl lcEmployeeCode;
        private LabelControl lcEmployeeName;
        private LabelControl lcGroup;
        private LabelControl lcMainAddress;
        private LabelControl lcPosition;
        private DateTime m_BeginDate;
        private string m_EmployeeCode = "";
        private DateTime m_EndDate;
        private bool m_Filter = false;
        private RepositoryItemDateEdit repBeginDate;
        private RepositoryItemGridLookUpEdit repEmployee;
        private RepositoryItemComboBox repEmployeeName;
        private RepositoryItemComboBox repFilter;
        private GridView repositoryItemGridLookUpEdit1View;
        private RepositoryItemDateEdit repToDate;
        private XtraTabPage tabAccident;
        private XtraTabPage tabAdvance;
        private XtraTabPage tabAssignment;
        private XtraTabPage tabBreakWork;
        private XtraTabPage tabConfirmTimeKeeper;
        private XtraTabPage tabDiscipline;
        private XtraTabPage tabPetition;
        private XtraTabPage tabPosition;
        private XtraTabPage tabRate;
        private XtraTabPage tabReward;
        private XtraTabPage tabSalary;
        private XtraTabPage tabTraining;
        private TextEdit txtAddress;
        private TextEdit txtEmail;
        private TextEdit txtID;
        private TextEdit txtName;
        private TextEdit txtPhone;
        private TextEdit txtPosition;
        private xucDateEdit xdeBirthday;
        private XtraTabControl xtraTabControl1;
        private HRM.CORE.Process.xucAccident xucAccident;
        private HRM.CORE.Process.xucAdvance xucAdvance;
        private HRM.CORE.Process.xucAssignment xucAssignment;
        private HRM.CORE.Process.xucBreakWork xucBreakWork;
        private HRM.CORE.Process.xucConfirmTimeKeeper xucConfirmTimeKeeper;
        private HRM.CORE.Process.xucDiscipline xucDiscipline;
        private HRM.CORE.Process.xucPetition xucPetition;
        private HRM.CORE.Process.xucPosition xucPosition;
        private HRM.CORE.Process.xucRate xucRate;
        private HRM.CORE.Process.xucReward xucReward;
        private HRM.CORE.Process.xucSalary xucSalary;
        private HRM.CORE.Process.xucTraining xucTraining;

#endregion

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xfmProcess));
            this.barManager1 = new BarManager(this.components);
            this.bar1 = new Bar();
            this.bbiFilterBy = new BarEditItem();
            this.repEmployee = new RepositoryItemGridLookUpEdit();
            this.repositoryItemGridLookUpEdit1View = new GridView();
            this.gridColumn5 = new GridColumn();
            this.gridColumn6 = new GridColumn();
            this.gridColumn7 = new GridColumn();
            this.cboEmployeeName = new BarEditItem();
            this.repEmployeeName = new RepositoryItemComboBox();
            this.bbiFilter = new BarEditItem();
            this.repFilter = new RepositoryItemComboBox();
            this.bbiBeginDate = new BarEditItem();
            this.repBeginDate = new RepositoryItemDateEdit();
            this.bbiEndDate = new BarEditItem();
            this.repToDate = new RepositoryItemDateEdit();
            this.bbiView = new BarButtonItem();
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.imageCollection2 = new DevExpress.Utils.ImageCollection(this.components);
            this.barButtonItem2 = new BarButtonItem();
            this.barButtonItem3 = new BarButtonItem();
            this.xtraTabControl1 = new XtraTabControl();
            this.tabAssignment = new XtraTabPage();
            this.tabDiscipline = new XtraTabPage();
            this.tabReward = new XtraTabPage();
            this.tabTraining = new XtraTabPage();
            this.tabAdvance = new XtraTabPage();
            this.tabRate = new XtraTabPage();
            this.tabAccident = new XtraTabPage();
            this.tabPosition = new XtraTabPage();
            this.tabSalary = new XtraTabPage();
            this.tabBreakWork = new XtraTabPage();
            this.tabPetition = new XtraTabPage();
            this.tabConfirmTimeKeeper = new XtraTabPage();
            this.groupControl1 = new GroupControl();
            this.xdeBirthday = new xucDateEdit();
            this.txtPosition = new TextEdit();
            this.lcPosition = new LabelControl();
            this.lcGroup = new LabelControl();
            this.cboGroup = new ComboBoxEdit();
            this.lcDepartment = new LabelControl();
            this.cboDepartment = new ComboBoxEdit();
            this.lcBranch = new LabelControl();
            this.cboBranch = new ComboBoxEdit();
            this.txtAddress = new TextEdit();
            this.lcMainAddress = new LabelControl();
            this.txtEmail = new TextEdit();
            this.lcEmail = new LabelControl();
            this.txtPhone = new TextEdit();
            this.lcCellPhone = new LabelControl();
            this.chbSex = new CheckEdit();
            this.imgPhoto = new PictureEdit();
            this.txtName = new TextEdit();
            this.lcEmployeeCode = new LabelControl();
            this.lcEmployeeName = new LabelControl();
            this.txtID = new TextEdit();
            this.gridColumn1 = new GridColumn();
            this.gridColumn2 = new GridColumn();
            this.gridColumn3 = new GridColumn();
            this.gridColumn4 = new GridColumn();
            this.barManager1.BeginInit();
            this.repEmployee.BeginInit();
            this.repositoryItemGridLookUpEdit1View.BeginInit();
            this.repEmployeeName.BeginInit();
            this.repFilter.BeginInit();
            this.repBeginDate.BeginInit();
            this.repBeginDate.VistaTimeProperties.BeginInit();
            this.repToDate.BeginInit();
            this.repToDate.VistaTimeProperties.BeginInit();
            this.imageCollection2.BeginInit();
            this.xtraTabControl1.BeginInit();
            this.xtraTabControl1.SuspendLayout();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.txtPosition.Properties.BeginInit();
            this.cboGroup.Properties.BeginInit();
            this.cboDepartment.Properties.BeginInit();
            this.cboBranch.Properties.BeginInit();
            this.txtAddress.Properties.BeginInit();
            this.txtEmail.Properties.BeginInit();
            this.txtPhone.Properties.BeginInit();
            this.chbSex.Properties.BeginInit();
            this.imgPhoto.Properties.BeginInit();
            this.txtName.Properties.BeginInit();
            this.txtID.Properties.BeginInit();
            base.SuspendLayout();
            this.barManager1.Bars.AddRange(new Bar[] { this.bar1 });
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Images = this.imageCollection2;
            this.barManager1.Items.AddRange(new BarItem[] { this.bbiFilterBy, this.bbiView, this.cboEmployeeName, this.bbiFilter, this.bbiBeginDate, this.bbiEndDate, this.barButtonItem2, this.barButtonItem3 });
            this.barManager1.MaxItemId = 9;
            this.barManager1.RepositoryItems.AddRange(new RepositoryItem[] { this.repEmployee, this.repEmployeeName, this.repFilter, this.repBeginDate, this.repToDate });
            this.bar1.BarName = "Tools";
            this.bar1.DockCol = 0;
            this.bar1.DockRow = 0;
            this.bar1.DockStyle = BarDockStyle.Top;
            this.bar1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiFilterBy, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.cboEmployeeName, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiFilter, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiBeginDate, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiEndDate, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiView, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph) });
            this.bar1.OptionsBar.UseWholeRow = true;
            this.bar1.Text = "Tools";
            this.bbiFilterBy.Caption = "Lọc Theo Nh\x00e2n Vi\x00ean:";
            this.bbiFilterBy.Edit = this.repEmployee;
            this.bbiFilterBy.Id = 0;
            this.bbiFilterBy.Name = "bbiFilterBy";
            this.bbiFilterBy.Width = 100;
            this.repEmployee.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.repEmployee.Appearance.Options.UseFont = true;
            this.repEmployee.AutoHeight = false;
            this.repEmployee.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repEmployee.Name = "repEmployee";
            this.repEmployee.NullText = "[Chọn nh\x00e2n vi\x00ean theo m\x00e3 số]";
            this.repEmployee.View = this.repositoryItemGridLookUpEdit1View;
            this.repositoryItemGridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.gridColumn5, this.gridColumn6, this.gridColumn7 });
            this.repositoryItemGridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.repositoryItemGridLookUpEdit1View.Name = "repositoryItemGridLookUpEdit1View";
            this.repositoryItemGridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.repositoryItemGridLookUpEdit1View.OptionsView.ShowAutoFilterRow = true;
            this.repositoryItemGridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.gridColumn5.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.gridColumn5.FieldName = "EmployeeCode";
            this.gridColumn5.Name = "gridColumn5";
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 0;
            this.gridColumn5.Width = 0x57;
            this.gridColumn6.Caption = "Họ l\x00f3t";
            this.gridColumn6.FieldName = "FirstName";
            this.gridColumn6.Name = "gridColumn6";
            this.gridColumn6.Visible = true;
            this.gridColumn6.VisibleIndex = 1;
            this.gridColumn6.Width = 130;
            this.gridColumn7.Caption = "T\x00ean";
            this.gridColumn7.FieldName = "LastName";
            this.gridColumn7.Name = "gridColumn7";
            this.gridColumn7.Visible = true;
            this.gridColumn7.VisibleIndex = 2;
            this.gridColumn7.Width = 80;
            this.cboEmployeeName.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.cboEmployeeName.Appearance.Options.UseFont = true;
            this.cboEmployeeName.Caption = "-";
            this.cboEmployeeName.Edit = this.repEmployeeName;
            this.cboEmployeeName.Id = 2;
            this.cboEmployeeName.Name = "cboEmployeeName";
            this.cboEmployeeName.Width = 150;
            this.repEmployeeName.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.repEmployeeName.Appearance.Options.UseFont = true;
            this.repEmployeeName.AutoHeight = false;
            this.repEmployeeName.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repEmployeeName.Name = "repEmployeeName";
            this.repEmployeeName.NullText = "[T\x00ean Nh\x00e2n Vi\x00ean]";
            this.repEmployeeName.ReadOnly = true;
            this.bbiFilter.Caption = "Hiển Thị";
            this.bbiFilter.Edit = this.repFilter;
            this.bbiFilter.Id = 3;
            this.bbiFilter.Name = "bbiFilter";
            this.bbiFilter.Width = 120;
            this.repFilter.AutoHeight = false;
            this.repFilter.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repFilter.Items.AddRange(new object[] { "<Tất Cả>", "<Theo Thời Gian>" });
            this.repFilter.Name = "repFilter";
            this.repFilter.TextEditStyle = TextEditStyles.DisableTextEditor;
            this.repFilter.SelectedIndexChanged += new EventHandler(this.repFilter_SelectedIndexChanged);
            this.bbiBeginDate.Caption = "Từ Ng\x00e0y:";
            this.bbiBeginDate.Edit = this.repBeginDate;
            this.bbiBeginDate.Id = 4;
            this.bbiBeginDate.Name = "bbiBeginDate";
            this.bbiBeginDate.Visibility = BarItemVisibility.Never;
            this.bbiBeginDate.Width = 80;
            this.repBeginDate.AutoHeight = false;
            this.repBeginDate.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repBeginDate.Name = "repBeginDate";
            this.repBeginDate.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.bbiEndDate.Caption = "Đến Ng\x00e0y:";
            this.bbiEndDate.Edit = this.repToDate;
            this.bbiEndDate.Id = 5;
            this.bbiEndDate.Name = "bbiEndDate";
            this.bbiEndDate.Visibility = BarItemVisibility.Never;
            this.bbiEndDate.Width = 80;
            this.repToDate.AutoHeight = false;
            this.repToDate.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repToDate.Name = "repToDate";
            this.repToDate.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.bbiView.Caption = "Xem";
            this.bbiView.Id = 1;
            this.bbiView.ImageIndex = 3;
            this.bbiView.Name = "bbiView";
            this.bbiView.ItemClick += new ItemClickEventHandler(this.bbiView_ItemClick);
            //            this.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            //this.imageCollection2.Images.SetKeyName(0x3d, "Vista (35).ico");
            //this.imageCollection2.Images.SetKeyName(0x3e, "Security.ico");
            //this.imageCollection2.Images.SetKeyName(0x3f, "RibbonPrintPreview_DocumentMapLarge.png");
            //this.imageCollection2.Images.SetKeyName(0x40, "11.png");
            //this.imageCollection2.Images.SetKeyName(0x41, "Sua.png");
            //this.imageCollection2.Images.SetKeyName(0x42, "Them.png");
            //this.imageCollection2.Images.SetKeyName(0x43, "PhanQuyen.png");
            //this.imageCollection2.Images.SetKeyName(0x44, "11.png");
            //this.imageCollection2.Images.SetKeyName(0x45, "plus.png");
            this.barButtonItem2.Caption = "Đ\x00f3ng";
            this.barButtonItem2.Id = 7;
            this.barButtonItem2.Name = "barButtonItem2";
            this.barButtonItem3.Caption = "Đ\x00f3ng";
            this.barButtonItem3.Id = 8;
            this.barButtonItem3.ImageIndex = 0x16;
            this.barButtonItem3.Name = "barButtonItem3";
            this.xtraTabControl1.BorderStyle = BorderStyles.NoBorder;
            this.xtraTabControl1.BorderStylePage = BorderStyles.NoBorder;
            this.xtraTabControl1.Dock = DockStyle.Fill;
            this.xtraTabControl1.HeaderButtons = TabButtons.Default | TabButtons.Next | TabButtons.Prev;
            this.xtraTabControl1.Location = new Point(0, 0x84);
            this.xtraTabControl1.Name = "xtraTabControl1";
            this.xtraTabControl1.SelectedTabPage = this.tabAssignment;
            this.xtraTabControl1.Size = new Size(0x424, 0x1f2);
            this.xtraTabControl1.TabIndex = 4;
            this.xtraTabControl1.TabPages.AddRange(new XtraTabPage[] { this.tabAssignment, this.tabDiscipline, this.tabReward, this.tabTraining, this.tabAdvance, this.tabRate, this.tabAccident, this.tabPosition, this.tabSalary, this.tabBreakWork, this.tabPetition, this.tabConfirmTimeKeeper });
            this.xtraTabControl1.Selected += new TabPageEventHandler(this.xtraTabControl1_Selected);
            this.tabAssignment.Name = "tabAssignment";
            this.tabAssignment.Size = new Size(0x41d, 0x1d5);
            this.tabAssignment.Text = "Đi C\x00f4ng T\x00e1c";
            this.tabDiscipline.Name = "tabDiscipline";
            this.tabDiscipline.Size = new Size(0x41d, 0x1d5);
            this.tabDiscipline.Text = "Kỷ Luật";
            this.tabReward.Name = "tabReward";
            this.tabReward.Size = new Size(0x41d, 0x1d5);
            this.tabReward.Text = "Khen Thưởng";
            this.tabTraining.Name = "tabTraining";
            this.tabTraining.Size = new Size(0x41d, 0x1d5);
            this.tabTraining.Text = "Qu\x00e1 Tr\x00ecnh Đ\x00e0o Tạo";
            this.tabAdvance.Name = "tabAdvance";
            this.tabAdvance.Size = new Size(0x41d, 0x1d5);
            this.tabAdvance.Text = "Tạm Ứng Lương";
            this.tabRate.Name = "tabRate";
            this.tabRate.Size = new Size(0x41d, 0x1d5);
            this.tabRate.Text = "Đ\x00e1nh Gi\x00e1";
            this.tabAccident.Name = "tabAccident";
            this.tabAccident.Size = new Size(0x41d, 0x1d5);
            this.tabAccident.Text = "Tai Nạn Lao Động";
            this.tabPosition.Name = "tabPosition";
            this.tabPosition.Size = new Size(0x41d, 0x1d5);
            this.tabPosition.Text = "Thay Đổi Chức Vụ";
            this.tabSalary.Name = "tabSalary";
            this.tabSalary.Size = new Size(0x41d, 0x1d5);
            this.tabSalary.Text = "Thay Đổi Lương";
            this.tabBreakWork.Name = "tabBreakWork";
            this.tabBreakWork.Size = new Size(0x41d, 0x1d5);
            this.tabBreakWork.Text = "Ngưng Việc";
            this.tabPetition.Name = "tabPetition";
            this.tabPetition.Size = new Size(0x41d, 0x1d5);
            this.tabPetition.Text = "Đơn Xin Nghỉ Ph\x00e9p";
            this.tabConfirmTimeKeeper.Name = "tabConfirmTimeKeeper";
            this.tabConfirmTimeKeeper.Size = new Size(0x41d, 0x1d5);
            this.tabConfirmTimeKeeper.Text = "X\x00e1c Nhận Giờ C\x00f4ng";
            this.groupControl1.BorderStyle = BorderStyles.NoBorder;
            this.groupControl1.Controls.Add(this.xdeBirthday);
            this.groupControl1.Controls.Add(this.txtPosition);
            this.groupControl1.Controls.Add(this.lcPosition);
            this.groupControl1.Controls.Add(this.lcGroup);
            this.groupControl1.Controls.Add(this.cboGroup);
            this.groupControl1.Controls.Add(this.lcDepartment);
            this.groupControl1.Controls.Add(this.cboDepartment);
            this.groupControl1.Controls.Add(this.lcBranch);
            this.groupControl1.Controls.Add(this.cboBranch);
            this.groupControl1.Controls.Add(this.txtAddress);
            this.groupControl1.Controls.Add(this.lcMainAddress);
            this.groupControl1.Controls.Add(this.txtEmail);
            this.groupControl1.Controls.Add(this.lcEmail);
            this.groupControl1.Controls.Add(this.txtPhone);
            this.groupControl1.Controls.Add(this.lcCellPhone);
            this.groupControl1.Controls.Add(this.chbSex);
            this.groupControl1.Controls.Add(this.imgPhoto);
            this.groupControl1.Controls.Add(this.txtName);
            this.groupControl1.Controls.Add(this.lcEmployeeCode);
            this.groupControl1.Controls.Add(this.lcEmployeeName);
            this.groupControl1.Controls.Add(this.txtID);
            this.groupControl1.Dock = DockStyle.Top;
            this.groupControl1.Location = new Point(0, 0x1a);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0x424, 0x6a);
            this.groupControl1.TabIndex = 5;
            this.groupControl1.Text = "groupControl1";
            this.xdeBirthday.Day = 1;
            this.xdeBirthday.Location = new Point(0x181, 30);
            this.xdeBirthday.Month = 1;
            this.xdeBirthday.Name = "xdeBirthday";
            this.xdeBirthday.ReadOnly = true;
            this.xdeBirthday.Size = new Size(180, 20);
            this.xdeBirthday.TabIndex = 0x16;
            this.xdeBirthday.Year = 0x7dd;
            this.txtPosition.EditValue = "[Chức danh hiện tại]";
            this.txtPosition.Location = new Point(0x289, 5);
            this.txtPosition.MenuManager = this.barManager1;
            this.txtPosition.Name = "txtPosition";
            this.txtPosition.Properties.ReadOnly = true;
            this.txtPosition.Size = new Size(0xe9, 20);
            this.txtPosition.TabIndex = 0x15;
            this.lcPosition.Location = new Point(0x225, 8);
            this.lcPosition.Name = "lcPosition";
            this.lcPosition.Size = new Size(0x5e, 13);
            this.lcPosition.TabIndex = 20;
            this.lcPosition.Text = "Chức danh hiện tại:";
            this.lcGroup.Location = new Point(0x24c, 0x56);
            this.lcGroup.Name = "lcGroup";
            this.lcGroup.Size = new Size(0x2d, 13);
            this.lcGroup.TabIndex = 0x13;
            this.lcGroup.Text = "Tổ nh\x00f3m:";
            this.cboGroup.Location = new Point(0x289, 0x52);
            this.cboGroup.MenuManager = this.barManager1;
            this.cboGroup.Name = "cboGroup";
            this.cboGroup.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboGroup.Properties.ReadOnly = true;
            this.cboGroup.Size = new Size(0xe9, 20);
            this.cboGroup.TabIndex = 0x12;
            this.lcDepartment.Location = new Point(0x24c, 60);
            this.lcDepartment.Name = "lcDepartment";
            this.lcDepartment.Size = new Size(0x37, 13);
            this.lcDepartment.TabIndex = 0x11;
            this.lcDepartment.Text = "Ph\x00f2ng ban:";
            this.cboDepartment.Location = new Point(0x289, 0x38);
            this.cboDepartment.MenuManager = this.barManager1;
            this.cboDepartment.Name = "cboDepartment";
            this.cboDepartment.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboDepartment.Properties.ReadOnly = true;
            this.cboDepartment.Size = new Size(0xe9, 20);
            this.cboDepartment.TabIndex = 0x10;
            this.lcBranch.Location = new Point(0x24c, 0x22);
            this.lcBranch.Name = "lcBranch";
            this.lcBranch.Size = new Size(0x34, 13);
            this.lcBranch.TabIndex = 15;
            this.lcBranch.Text = "Chi nh\x00e1nh:";
            this.cboBranch.Location = new Point(0x289, 30);
            this.cboBranch.MenuManager = this.barManager1;
            this.cboBranch.Name = "cboBranch";
            this.cboBranch.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboBranch.Properties.ReadOnly = true;
            this.cboBranch.Size = new Size(0xe9, 20);
            this.cboBranch.TabIndex = 14;
            this.txtAddress.Location = new Point(0xb7, 0x53);
            this.txtAddress.MenuManager = this.barManager1;
            this.txtAddress.Name = "txtAddress";
            this.txtAddress.Properties.ReadOnly = true;
            this.txtAddress.Size = new Size(0x17e, 20);
            this.txtAddress.TabIndex = 11;
            this.lcMainAddress.Location = new Point(0x6d, 0x56);
            this.lcMainAddress.Name = "lcMainAddress";
            this.lcMainAddress.Size = new Size(0x24, 13);
            this.lcMainAddress.TabIndex = 10;
            this.lcMainAddress.Text = "Địa chỉ:";
            this.txtEmail.Location = new Point(0x148, 0x39);
            this.txtEmail.MenuManager = this.barManager1;
            this.txtEmail.Name = "txtEmail";
            this.txtEmail.Properties.ReadOnly = true;
            this.txtEmail.Size = new Size(0xed, 20);
            this.txtEmail.TabIndex = 9;
            this.lcEmail.Location = new Point(0x126, 0x3b);
            this.lcEmail.Name = "lcEmail";
            this.lcEmail.Size = new Size(0x1c, 13);
            this.lcEmail.TabIndex = 8;
            this.lcEmail.Text = "Email:";
            this.txtPhone.Location = new Point(0xb7, 0x39);
            this.txtPhone.MenuManager = this.barManager1;
            this.txtPhone.Name = "txtPhone";
            this.txtPhone.Properties.ReadOnly = true;
            this.txtPhone.Size = new Size(0x68, 20);
            this.txtPhone.TabIndex = 7;
            this.lcCellPhone.Location = new Point(0x6d, 0x3b);
            this.lcCellPhone.Name = "lcCellPhone";
            this.lcCellPhone.Size = new Size(0x42, 13);
            this.lcCellPhone.TabIndex = 6;
            this.lcCellPhone.Text = "Số điện thoại:";
            this.chbSex.Location = new Point(0x123, 6);
            this.chbSex.MenuManager = this.barManager1;
            this.chbSex.Name = "chbSex";
            this.chbSex.Properties.Caption = "Nam";
            this.chbSex.Properties.ReadOnly = true;
            this.chbSex.Size = new Size(0x4b, 0x13);
            this.chbSex.TabIndex = 5;
            this.imgPhoto.Location = new Point(7, 5);
            this.imgPhoto.MenuManager = this.barManager1;
            this.imgPhoto.Name = "imgPhoto";
            this.imgPhoto.Properties.NullText = "[Chưa c\x00f3 h\x00ecnh]";
            this.imgPhoto.Properties.ReadOnly = true;
            this.imgPhoto.Properties.SizeMode = PictureSizeMode.Zoom;
            this.imgPhoto.Size = new Size(0x60, 0x62);
            this.imgPhoto.TabIndex = 0;
            this.txtName.EditValue = "[T\x00ean nh\x00e2n vi\x00ean]";
            this.txtName.Location = new Point(0xb7, 0x1f);
            this.txtName.MenuManager = this.barManager1;
            this.txtName.Name = "txtName";
            this.txtName.Properties.ReadOnly = true;
            this.txtName.Size = new Size(0xb7, 20);
            this.txtName.TabIndex = 4;
            this.lcEmployeeCode.Location = new Point(0x6d, 7);
            this.lcEmployeeCode.Name = "lcEmployeeCode";
            this.lcEmployeeCode.Size = new Size(0x44, 13);
            this.lcEmployeeCode.TabIndex = 1;
            this.lcEmployeeCode.Text = "M\x00e3 nh\x00e2n vi\x00ean:";
            this.lcEmployeeName.Location = new Point(0x6d, 0x21);
            this.lcEmployeeName.Name = "lcEmployeeName";
            this.lcEmployeeName.Size = new Size(0x48, 13);
            this.lcEmployeeName.TabIndex = 3;
            this.lcEmployeeName.Text = "T\x00ean nh\x00e2n vi\x00ean:";
            this.txtID.EditValue = "[M\x00e3 nh\x00e2n vi\x00ean]";
            this.txtID.Location = new Point(0xb7, 5);
            this.txtID.MenuManager = this.barManager1;
            this.txtID.Name = "txtID";
            this.txtID.Properties.ReadOnly = true;
            this.txtID.Size = new Size(0x68, 20);
            this.txtID.TabIndex = 2;
            this.gridColumn1.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.gridColumn1.FieldName = "EmployeeCode";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn2.Caption = "Họ l\x00f3t";
            this.gridColumn2.FieldName = "FirstName";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 1;
            this.gridColumn3.Caption = "T\x00ean";
            this.gridColumn3.FieldName = "LastName";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 2;
            this.gridColumn4.Caption = "Giới t\x00ednh";
            this.gridColumn4.FieldName = "Sex";
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 3;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            //            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x424, 630);
            base.Controls.Add(this.xtraTabControl1);
            base.Controls.Add(this.groupControl1);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xfmProcess";
            this.Text = "Qu\x00e1 Tr\x00ecnh L\x00e0m Việc | Theo Nh\x00e2n Vi\x00ean";
            this.barManager1.EndInit();
            this.repEmployee.EndInit();
            this.repositoryItemGridLookUpEdit1View.EndInit();
            this.repEmployeeName.EndInit();
            this.repFilter.EndInit();
            this.repBeginDate.VistaTimeProperties.EndInit();
            this.repBeginDate.EndInit();
            this.repToDate.VistaTimeProperties.EndInit();
            this.repToDate.EndInit();
            this.imageCollection2.EndInit();
            this.xtraTabControl1.EndInit();
            this.xtraTabControl1.ResumeLayout(false);
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.groupControl1.PerformLayout();
            this.txtPosition.Properties.EndInit();
            this.cboGroup.Properties.EndInit();
            this.cboDepartment.Properties.EndInit();
            this.cboBranch.Properties.EndInit();
            this.txtAddress.Properties.EndInit();
            this.txtEmail.Properties.EndInit();
            this.txtPhone.Properties.EndInit();
            this.chbSex.Properties.EndInit();
            this.imgPhoto.Properties.EndInit();
            this.txtName.Properties.EndInit();
            this.txtID.Properties.EndInit();
            base.ResumeLayout(false);
        }


        private void Init()
        {
            new HRM_EMPLOYEE().AddRepositoryGridLookupEdit(this.repEmployee);
            this.repEmployee.EditValueChanging += new ChangingEventHandler(this.repEmployee_EditValueChanging);
            this.repEmployee.EditValueChanged += new EventHandler(this.repEmployee_EditValueChanged);
            this.bbiFilter.EditValue = "<Tất Cả>";
            try
            {
                this.bbiBeginDate.EditValue = new DateTime(DateTime.Now.Year - 1, DateTime.Now.Month, DateTime.Now.Day);
            }
            catch
            {
                this.bbiBeginDate.EditValue = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
            }
            this.bbiEndDate.EditValue = DateTime.Now;
            if (this.xucAssignment == null)
            {
                this.xucAssignment = new HRM.CORE.Process.xucAssignment(this.m_EmployeeCode);
                this.xucAssignment.Dock = DockStyle.Fill;
                this.tabAssignment.Controls.Add(this.xucAssignment);
            }
        }

        public xfmProcess()
        {
            this.InitializeComponent();
            this.InitMultiLanguages();
            this.Init();
        }

        private void bbiView_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.SetData();
        }

        private void InitMultiLanguages()
        {
            this.Text = MultiLanguages.GetString("tbl_WorkProcess", "WorkProcess", this.Text);
            this.tabAssignment.Text = MultiLanguages.GetString("tbl_WorkProcess", "Assignment", this.tabAssignment.Text);
            this.tabAdvance.Text = MultiLanguages.GetString("tbl_WorkProcess", "Advance", this.tabAdvance.Text);
            this.tabDiscipline.Text = MultiLanguages.GetString("tbl_WorkProcess", "Discipline", this.tabDiscipline.Text);
            this.tabReward.Text = MultiLanguages.GetString("tbl_WorkProcess", "Reward", this.tabReward.Text);
            this.tabTraining.Text = MultiLanguages.GetString("tbl_WorkProcess", "Training", this.tabTraining.Text);
            this.tabRate.Text = MultiLanguages.GetString("tbl_WorkProcess", "Assessment", this.tabRate.Text);
            this.tabAccident.Text = MultiLanguages.GetString("tbl_WorkProcess", "Accident", this.tabAccident.Text);
            this.tabPosition.Text = MultiLanguages.GetString("tbl_WorkProcess", "ChangePosition", this.tabPosition.Text);
            this.tabSalary.Text = MultiLanguages.GetString("tbl_WorkProcess", "ChangeSalary", this.tabSalary.Text);
            this.bbiFilterBy.Caption = MultiLanguages.GetString("tbl_WorkProcess", "FilterByEmployee", this.bbiFilterBy.Caption);
            this.bbiFilter.Caption = MultiLanguages.GetString("tbl_WorkProcess", "Show", this.bbiFilter.Caption);
            this.bbiBeginDate.Caption = MultiLanguages.GetString("tbl_WorkProcess", "FromDate", this.bbiBeginDate.Caption);
            this.bbiEndDate.Caption = MultiLanguages.GetString("tbl_WorkProcess", "EndDate", this.bbiEndDate.Caption);
            this.bbiView.Caption = MultiLanguages.GetString("tbl_WorkProcess", "View", this.bbiView.Caption);
            this.imgPhoto.Properties.NullText = MultiLanguages.GetString("tbl_WorkProcess", "NoPhoto", this.imgPhoto.Properties.NullText);
            this.lcBranch.Text = MultiLanguages.GetString("tbl_WorkProcess", "BranchName", this.lcBranch.Text);
            this.lcDepartment.Text = MultiLanguages.GetString("tbl_WorkProcess", "DepartmentName", this.lcDepartment.Text);
            this.lcGroup.Text = MultiLanguages.GetString("tbl_WorkProcess", "GroupName", this.lcGroup.Text);
            this.lcEmployeeCode.Text = MultiLanguages.GetString("tbl_WorkProcess", "EmployeeCode", this.lcEmployeeCode.Text);
            this.lcEmployeeName.Text = MultiLanguages.GetString("tbl_WorkProcess", "EmployeeName", this.lcEmployeeName.Text);
            this.chbSex.Text = MultiLanguages.GetString("tbl_WorkProcess", "Sex", this.chbSex.Text);
            this.lcCellPhone.Text = MultiLanguages.GetString("tbl_WorkProcess", "CellPhone", this.lcCellPhone.Text);
            this.lcMainAddress.Text = MultiLanguages.GetString("tbl_WorkProcess", "MainAddress", this.lcMainAddress.Text);
            this.lcPosition.Text = MultiLanguages.GetString("tbl_WorkProcess", "Position", this.lcPosition.Text);
        }

        private void repEmployee_EditValueChanged(object sender, EventArgs e)
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.m_EmployeeCode);
            this.txtID.Text = this.m_EmployeeCode = hrm_employee.EmployeeCode;
            this.txtName.Text = hrm_employee.FirstName.ToString() + " " + hrm_employee.LastName.ToString();
            this.cboEmployeeName.EditValue = hrm_employee.FirstName.ToString() + " " + hrm_employee.LastName.ToString();
            this.xdeBirthday.Day = hrm_employee.BirthdayDay;
            this.xdeBirthday.Month = hrm_employee.BirthdayMonth;
            this.xdeBirthday.Year = hrm_employee.BirthdayYear;
            this.chbSex.Checked = hrm_employee.Sex;
            this.imgPhoto.Image = hrm_employee.Photo;
            this.txtPhone.Text = hrm_employee.CellPhone;
            this.txtEmail.Text = hrm_employee.Email;
            this.txtAddress.Text = hrm_employee.MainAddress;
            this.txtPosition.Text = hrm_employee.Position;
            this.cboBranch.Text = hrm_employee.BranchName;
            this.cboDepartment.Text = hrm_employee.DepartmentName;
            this.cboGroup.Text = hrm_employee.GroupName;
            this.SetData();
        }

        private void repEmployee_EditValueChanging(object sender, ChangingEventArgs e)
        {
            this.m_EmployeeCode = e.NewValue.ToString();
        }

        private void repFilter_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.SetFilerDate(this.m_Filter = !this.m_Filter);
        }

        private void SetData()
        {
            this.m_BeginDate = Convert.ToDateTime(this.bbiBeginDate.EditValue.ToString());
            this.m_EndDate = Convert.ToDateTime(this.bbiEndDate.EditValue.ToString());
            if (!this.m_Filter)
            {
                if (this.xucAssignment != null)
                {
                    this.xucAssignment.SetData(this.m_EmployeeCode);
                }
                if (this.xucDiscipline != null)
                {
                    this.xucDiscipline.SetData(this.m_EmployeeCode);
                }
                if (this.xucReward != null)
                {
                    this.xucReward.SetData(this.m_EmployeeCode);
                }
                if (this.xucTraining != null)
                {
                    this.xucTraining.SetData(this.m_EmployeeCode);
                }
                if (this.xucAdvance != null)
                {
                    this.xucAdvance.SetData(this.m_EmployeeCode);
                }
                if (this.xucAccident != null)
                {
                    this.xucAccident.SetData(this.m_EmployeeCode);
                }
                if (this.xucRate != null)
                {
                    this.xucRate.SetData(this.m_EmployeeCode);
                }
                if (this.xucPosition != null)
                {
                    this.xucPosition.SetData(this.m_EmployeeCode);
                }
                if (this.xucSalary != null)
                {
                    this.xucSalary.SetData(this.m_EmployeeCode);
                }
                if (this.xucPetition != null)
                {
                    this.xucPetition.SetData(this.m_EmployeeCode);
                }
                if (this.xucConfirmTimeKeeper != null)
                {
                    this.xucConfirmTimeKeeper.SetData(this.m_EmployeeCode);
                }
                if (this.xucBreakWork != null)
                {
                    this.xucBreakWork.SetData(this.m_EmployeeCode);
                }
            }
            else
            {
                if (this.xucAssignment != null)
                {
                    this.xucAssignment.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucDiscipline != null)
                {
                    this.xucDiscipline.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucReward != null)
                {
                    this.xucReward.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucTraining != null)
                {
                    this.xucTraining.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucAdvance != null)
                {
                    this.xucAdvance.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucAccident != null)
                {
                    this.xucAccident.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucRate != null)
                {
                    this.xucRate.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucPosition != null)
                {
                    this.xucPosition.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucSalary != null)
                {
                    this.xucSalary.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucPetition != null)
                {
                    this.xucPetition.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucConfirmTimeKeeper != null)
                {
                    this.xucConfirmTimeKeeper.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
                if (this.xucBreakWork != null)
                {
                    this.xucBreakWork.SetData(this.m_EmployeeCode, this.m_BeginDate, this.m_EndDate);
                }
            }
        }

        private void SetFilerDate(bool value)
        {
            if (value)
            {
                this.bbiBeginDate.Visibility = BarItemVisibility.Always;
                this.bbiEndDate.Visibility = BarItemVisibility.Always;
            }
            else
            {
                this.bbiBeginDate.Visibility = BarItemVisibility.Never;
                this.bbiEndDate.Visibility = BarItemVisibility.Never;
            }
        }

        private void xtraTabControl1_Selected(object sender, TabPageEventArgs e)
        {
            if (e.Page == this.tabAssignment)
            {
                if (this.xucAssignment == null)
                {
                    this.xucAssignment = new HRM.CORE.Process.xucAssignment(this.m_EmployeeCode);
                    this.xucAssignment.Dock = DockStyle.Fill;
                    this.tabAssignment.Controls.Add(this.xucAssignment);
                }
            }
            else if (e.Page == this.tabDiscipline)
            {
                if (this.xucDiscipline == null)
                {
                    this.xucDiscipline = new HRM.CORE.Process.xucDiscipline(this.m_EmployeeCode);
                    this.xucDiscipline.Dock = DockStyle.Fill;
                    this.tabDiscipline.Controls.Add(this.xucDiscipline);
                }
            }
            else if (e.Page == this.tabReward)
            {
                if (this.xucReward == null)
                {
                    this.xucReward = new HRM.CORE.Process.xucReward(this.m_EmployeeCode);
                    this.xucReward.Dock = DockStyle.Fill;
                    this.tabReward.Controls.Add(this.xucReward);
                }
            }
            else if (e.Page == this.tabTraining)
            {
                if (this.xucTraining == null)
                {
                    this.xucTraining = new HRM.CORE.Process.xucTraining(this.m_EmployeeCode);
                    this.xucTraining.Dock = DockStyle.Fill;
                    this.tabTraining.Controls.Add(this.xucTraining);
                }
            }
            else if (e.Page == this.tabAdvance)
            {
                if (this.xucAdvance == null)
                {
                    this.xucAdvance = new HRM.CORE.Process.xucAdvance(this.m_EmployeeCode);
                    this.xucAdvance.Dock = DockStyle.Fill;
                    this.tabAdvance.Controls.Add(this.xucAdvance);
                }
            }
            else if (e.Page == this.tabRate)
            {
                if (this.xucRate == null)
                {
                    this.xucRate = new HRM.CORE.Process.xucRate(this.m_EmployeeCode);
                    this.xucRate.Dock = DockStyle.Fill;
                    this.tabRate.Controls.Add(this.xucRate);
                }
            }
            else if (e.Page == this.tabAccident)
            {
                if (this.xucAccident == null)
                {
                    this.xucAccident = new HRM.CORE.Process.xucAccident(this.m_EmployeeCode);
                    this.xucAccident.Dock = DockStyle.Fill;
                    this.tabAccident.Controls.Add(this.xucAccident);
                }
            }
            else if (e.Page == this.tabPosition)
            {
                if (this.xucPosition == null)
                {
                    this.xucPosition = new HRM.CORE.Process.xucPosition(this.m_EmployeeCode);
                    this.xucPosition.Dock = DockStyle.Fill;
                    this.tabPosition.Controls.Add(this.xucPosition);
                }
            }
            else if (e.Page == this.tabSalary)
            {
                if (this.xucSalary == null)
                {
                    this.xucSalary = new HRM.CORE.Process.xucSalary(this.m_EmployeeCode);
                    this.xucSalary.Dock = DockStyle.Fill;
                    this.tabSalary.Controls.Add(this.xucSalary);
                }
            }
            else if (e.Page == this.tabPetition)
            {
                if (this.xucPetition == null)
                {
                    this.xucPetition = new HRM.CORE.Process.xucPetition(this.m_EmployeeCode);
                    this.xucPetition.Dock = DockStyle.Fill;
                    this.tabPetition.Controls.Add(this.xucPetition);
                }
            }
            else if (e.Page == this.tabConfirmTimeKeeper)
            {
                if (this.xucConfirmTimeKeeper == null)
                {
                    this.xucConfirmTimeKeeper = new HRM.CORE.Process.xucConfirmTimeKeeper(this.m_EmployeeCode);
                    this.xucConfirmTimeKeeper.Dock = DockStyle.Fill;
                    this.tabConfirmTimeKeeper.Controls.Add(this.xucConfirmTimeKeeper);
                }
            }
            else if ((e.Page == this.tabBreakWork) && (this.xucBreakWork == null))
            {
                this.xucBreakWork = new HRM.CORE.Process.xucBreakWork(this.m_EmployeeCode);
                this.xucBreakWork.Dock = DockStyle.Fill;
                this.tabBreakWork.Controls.Add(this.xucBreakWork);
            }
        }
    }
}

